package main

import (
	"flag"
	"fmt"
	"lotteryrobot/client"
	"lotteryrobot/server"
)

var (
	s string
)

func init() {
	// 注意 `signal`。默认是 -s string，有了 `signal` 之后，变为 -s signal
	flag.StringVar(&s, "s", "", "start up service")
}

func main() {
	flag.Parse()

	if s == "" {
		fmt.Println("value is not empty.")
		return
	}
	switch s {
	case "server":
		server.Run()
	case "client":
		client.Run()
	}
}
